/*************************************************************************
	> File Name: oj-471.cpp
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: 2021年02月02日 星期二 21时07分58秒
 ************************************************************************/
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main() {
    string n1, n2;    
    cin >> n1 >> n2;
    vector<int> ans(n1.size() + n2.size() + 5, 0);
    if (n1.size() < n2.size()) swap(n1, n2);
    reverse(begin(n1), end(n1));
    reverse(begin(n2), end(n2));
    for (int i = 0; i < n1.size(); ++i) {
        for (int j = 0; j < n2.size(); ++j) {
            ans[i + j] += (n1[i] - '0') * (n2[j] - '0');
        }
    }
    for (int i = 0; i < ans.size(); ++i) {
        if (ans[i] >= 10) {
            ans[i + 1] += ans[i] / 10;
            ans[i] %= 10;
        }
    }
    cout << ans[ans.size() - 1] << endl;
    for (int i = ans.size() - 1, flag = 0; i >= 0; --i) {
        if (ans[i]) flag = 1; 
        if (flag) cout << ans[i];
    }
    cout << endl;
    return 0;
}
